package com.rickpan.dto.response;

import java.util.List;

/**
 * 上传初始化响应DTO
 */
public class UploadInitResponse {
    
    private String uploadId;
    private boolean needUpload;
    private List<Integer> uploadedChunks;
    private Integer chunkSize;
    private Integer totalChunks;
    private ExistingFile existingFile;
    
    // 构造函数
    public UploadInitResponse() {}
    
    public UploadInitResponse(String uploadId, boolean needUpload, List<Integer> uploadedChunks, 
                             Integer chunkSize, Integer totalChunks) {
        this.uploadId = uploadId;
        this.needUpload = needUpload;
        this.uploadedChunks = uploadedChunks;
        this.chunkSize = chunkSize;
        this.totalChunks = totalChunks;
    }
    
    // Getter和Setter方法
    public String getUploadId() {
        return uploadId;
    }
    
    public void setUploadId(String uploadId) {
        this.uploadId = uploadId;
    }
    
    public boolean isNeedUpload() {
        return needUpload;
    }
    
    public void setNeedUpload(boolean needUpload) {
        this.needUpload = needUpload;
    }
    
    public List<Integer> getUploadedChunks() {
        return uploadedChunks;
    }
    
    public void setUploadedChunks(List<Integer> uploadedChunks) {
        this.uploadedChunks = uploadedChunks;
    }
    
    public Integer getChunkSize() {
        return chunkSize;
    }
    
    public void setChunkSize(Integer chunkSize) {
        this.chunkSize = chunkSize;
    }
    
    public Integer getTotalChunks() {
        return totalChunks;
    }
    
    public void setTotalChunks(Integer totalChunks) {
        this.totalChunks = totalChunks;
    }
    
    public ExistingFile getExistingFile() {
        return existingFile;
    }
    
    public void setExistingFile(ExistingFile existingFile) {
        this.existingFile = existingFile;
    }
    
    /**
     * 已存在文件信息
     */
    public static class ExistingFile {
        private Long id;
        private String fileName;
        private String url;
        
        public ExistingFile() {}
        
        public ExistingFile(Long id, String fileName, String url) {
            this.id = id;
            this.fileName = fileName;
            this.url = url;
        }
        
        public Long getId() {
            return id;
        }
        
        public void setId(Long id) {
            this.id = id;
        }
        
        public String getFileName() {
            return fileName;
        }
        
        public void setFileName(String fileName) {
            this.fileName = fileName;
        }
        
        public String getUrl() {
            return url;
        }
        
        public void setUrl(String url) {
            this.url = url;
        }
        
        @Override
        public String toString() {
            return "ExistingFile{" +
                    "id=" + id +
                    ", fileName='" + fileName + '\'' +
                    ", url='" + url + '\'' +
                    '}';
        }
    }
    
    @Override
    public String toString() {
        return "UploadInitResponse{" +
                "uploadId='" + uploadId + '\'' +
                ", needUpload=" + needUpload +
                ", uploadedChunks=" + uploadedChunks +
                ", chunkSize=" + chunkSize +
                ", totalChunks=" + totalChunks +
                ", existingFile=" + existingFile +
                '}';
    }
}
